import React, { memo } from "react";
import { CommentWrapper } from "./style";
import { formatTime } from "@/utils/time-util";

export default memo(function Comment(props) {
  const { avatar, nickName, comment, gmtCreate } = props.data;
  return (
    <CommentWrapper>
      <img src={avatar} alt="" />
      <div className="commnet">
        <div className="comment-left">
          <div className="nickname">{nickName}</div>
          <div className="content">{comment}</div>
        </div>
        <div className="time">{formatTime(gmtCreate)}</div>
      </div>
    </CommentWrapper>
  );
});
